#include "show.h"

#define X_Calibration 12

// int Num;
// int X_Line =  X_Calibration,Y_Line = 0;
// int Map_x = 0,Map_y = 0;
// int flag = 0;
// char tx_buff[30] ;//= {"line 0,0,100,200,1024\xff\xff\xff"};
/**
 * @brief 显示静态变量
 */
void Show_Static(void)
{
     //用户界面创建
     /*图形区*/
     OLED_DrawLine(12,0,12,63);
     //按键
     OLED_ShowString(0,0,"K1",OLED_6X8);
     OLED_ShowString(0,16,"K2",OLED_6X8);
     OLED_ShowString(0,32,"Ch",OLED_6X8);
     OLED_ShowString(0,48,"FY",OLED_6X8);
     //飞机状态
     OLED_ShowString(13,0,"LOC",OLED_6X8);
     OLED_ShowString(13,8,"FLY",OLED_6X8);
     //地图数据
     OLED_ShowString(13,16,"MAP",OLED_6X8);
     //
     OLED_ShowString(13,24,"REC",OLED_6X8);
     OLED_ShowString(13,32,"ANM",OLED_6X8);

     OLED_ShowString(32,40,"Lo",OLED_6X8);
     OLED_ShowString(45,40,"E",OLED_6X8);
     OLED_ShowString(58,40,"P",OLED_6X8);
     OLED_ShowString(71,40,"M",OLED_6X8);
     OLED_ShowString(84,40,"T",OLED_6X8);
     OLED_ShowString(97,40,"W",OLED_6X8);
     // OLED_ShowString(13,16,"MAP",OLED_6X8);

     OLED_DrawLine(X_Calibration,57,127,57);


     //串口屏
     // Screen_Point(10,50,BLUE);
     // Screen_Line(10,10,500,400,RED);
}



/**
 * @brief 显示动态变量
 */
void Show_Dynamic(void)
{
     /*数据更新区*/
     //按键
     OLED_ShowNum(0,8,KEY_TEXT.Key_Type,1,OLED_6X8);
     OLED_ShowNum(0,24,KEY_2.Key_Type,1,OLED_6X8);
     OLED_ShowNum(0,40,Temp[60],2,OLED_6X8);
     OLED_ShowNum(0,56,Screen_date.fly_state,1,OLED_6X8);
     //飞行状态     
     OLED_ShowNum(33,0,UVA_date.Mid_Date[2]/10,1,OLED_6X8);
     OLED_ShowNum(41,0,UVA_date.Mid_Date[2]%10,1,OLED_6X8);
     OLED_ShowNum(33,8,UVA_date.Mid_Date[1],1,OLED_6X8);
     OLED_ShowNum(41,8,Animal_N,1,OLED_6X8);
     //地图
     OLED_ShowNum(32,16,Screen_date.MAP[0],2,OLED_6X8);
     OLED_ShowNum(45,16,Screen_date.MAP[1],2,OLED_6X8);
     OLED_ShowNum(58,16,Screen_date.MAP[2],2,OLED_6X8);
     OLED_ShowNum(71,16,Screen_date.MAP[3],2,OLED_6X8);
     OLED_ShowNum(84,16,Screen_date.MAP[4],2,OLED_6X8);
     OLED_ShowNum(97,16,Screen_date.MAP[5],2,OLED_6X8);

     OLED_ShowNum(32,24,Usart_2_4G.recv_buff[0],2,OLED_6X8);
     OLED_ShowNum(45,24,Usart_2_4G.recv_buff[1],2,OLED_6X8);
     OLED_ShowNum(58,24,Usart_2_4G.recv_buff[2],2,OLED_6X8);
     OLED_ShowNum(71,24,Usart_2_4G.recv_buff[3],2,OLED_6X8);
     OLED_ShowNum(84,24,Usart_2_4G.recv_buff[4],2,OLED_6X8);
     OLED_ShowNum(97,24,Usart_2_4G.recv_buff[5],2,OLED_6X8);

     OLED_ShowNum(32,32,UVA_date.Mid_Date[2],2,OLED_6X8);
     OLED_ShowNum(45,32,UVA_date.Mid_Date[3],2,OLED_6X8);
     OLED_ShowNum(58,32,UVA_date.Mid_Date[4],2,OLED_6X8);
     OLED_ShowNum(71,32,UVA_date.Mid_Date[5],2,OLED_6X8);
     OLED_ShowNum(84,32,UVA_date.Mid_Date[6],2,OLED_6X8);
     OLED_ShowNum(97,32,UVA_date.Mid_Date[7],2,OLED_6X8);

     OLED_ShowNum(32,48,animal_date_num,2,OLED_6X8);
     // OLED_ShowNum(45,32,UVA_date.Mid_Date[3],2,OLED_6X8);
     // OLED_ShowNum(58,32,UVA_date.Mid_Date[4],2,OLED_6X8);
     // OLED_ShowNum(71,32,UVA_date.Mid_Date[5],2,OLED_6X8);
     // OLED_ShowNum(84,32,UVA_date.Mid_Date[6],2,OLED_6X8);
     // OLED_ShowNum(97,32,UVA_date.Mid_Date[7],2,OLED_6X8);

     // OLED_ShowNum(20,8,Screen_date.Data[0],2,OLED_6X8);
     // OLED_ShowNum(32,8,Screen_date.Data[1],2,OLED_6X8);
     // OLED_ShowNum(44,8,Screen_date.Data[2],2,OLED_6X8);
     // OLED_ShowNum(56,8,Screen_date.Data[3],2,OLED_6X8);
     // OLED_ShowNum(68,8,Screen_date.Data[4],2,OLED_6X8);
     // OLED_ShowNum(80,8,Screen_date.Data[5],2,OLED_6X8);
     // OLED_ShowNum(92,8,Screen_date.Data[6],2,OLED_6X8);
     // OLED_ShowNum(104,8,Screen_date.Data[7],2,OLED_6X8);
     // OLED_ShowNum(116,8,Screen_date.Data[8],2,OLED_6X8);

     // OLED_ShowNum(20,16,UVA_date.Data[0],2,OLED_6X8);
     // OLED_ShowNum(32,16,UVA_date.Data[1],2,OLED_6X8);
     // OLED_ShowNum(44,16,UVA_date.Data[60],2,OLED_6X8);
     // OLED_ShowNum(56,16,Screen_date.Data[3],2,OLED_6X8);
     // OLED_ShowNum(68,16,Screen_date.Data[4],2,OLED_6X8);
     // OLED_ShowNum(80,16,Screen_date.Data[5],2,OLED_6X8);
     // OLED_ShowNum(92,16,Screen_date.Data[6],2,OLED_6X8);
     // OLED_ShowNum(104,16,Screen_date.Data[7],2,OLED_6X8);
     // OLED_ShowNum(116,16,Screen_date.Data[8],2,OLED_6X8);
     //MAP显示
//      for(Num = 0;Num < 63; Num++)
//      {
//           if(flag == 0)
//           {
//                OLED_ShowNum(X_Line,Y_Line,Usart_Screen.recv_buff[Map_x],2,OLED_6X8);
//                OLED_Update();
//           }
//           else if(flag == 1)
//           {
//                OLED_ShowNum(X_Line,Y_Line,Screen_date.MAP[Map_x],2,OLED_6X8);
//                OLED_Update();
//           }
//           X_Line = X_Line+12;
//           Map_x ++;
//           if(X_Line>127)
//           {
//                Map_x = 0;
//                X_Line =  X_Calibration;
//                Y_Line = Y_Line+8;
//                Map_y++ ;
//                flag++;
//           }
//           if(Y_Line > 56 || Map_y > 6)
//           {
//                OLED_Update();
//                Y_Line = 0;
//                Map_y = 0;
//           }
//      }
}


